<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>菱形图片</title>
  <style>
    .pic{
      clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    }
  </style>
</head>
<body>
<img class="pic" src="../../img/rect.jpg" alt="img">
</body>
</html>